﻿Imports CommonLayer

Public Class frmAccountingObjectList

#Region "Declare"

    Public Overrides ReadOnly Property PermissionID() As PermissionEnum
        Get
            Return PermissionEnum.AccountingObject
        End Get
    End Property

    Public Overrides ReadOnly Property TreePermissionID() As PermissionEnum
        Get
            Return PermissionEnum.AccountingObjectCategory
        End Get
    End Property

#End Region

#Region "Event"

#End Region

#Region "Overridable"

    Protected Overrides Function GetFormDetail() As frmBaseDictionaryDetail
        Dim frm As New frmAccountingObjectDetail
        Return frm
    End Function

    Protected Overrides Function GetFormTreeDetail() As frmBaseDictionaryDetail
        Dim frm As New frmAccountingObjectCategoryDetail
        Return frm
    End Function

    Protected Overrides Function InitAddNewRow() As DataRow
        Return oBLDictionary.AddNewAccountingObject()
    End Function

    Public Overrides Function InitAddNewTreeRow() As DataRow
        Return oBLTree.AddNewAccountingObjectCategory()
    End Function

    Protected Overrides Sub InitGridData()
        IsLoadingData = True
        If Not oBLDictionary Is Nothing Then
            With oBLDictionary
                .BusinessObject.Tables(.TableName).Clear()
                .GetAllDataFollowOption(New Object() {2})
            End With
            SetActiveRowAfterBinding()

            bsList.Sort = CodeColumnName
        End If
        IsLoadingData = False
        BindingSourcePositionChanged()
    End Sub

#End Region

#Region "Sub/Function"

#End Region

End Class
